<?php

require_once "../router/Router.php";
use PolarisbackEndFrameRe\router\Router;

$router = new Router();
$router->loadRoutesFromFiles("./controllers");
$router->add(route: "/", controller: "MainController@index");
$router->add(route: "/about", controller: "MainController@about");
$router->add(route: "/article/{article_name}", controller: "MainController@article_index");

$router->add(route: "/username={name}/delete_article", controller: "MainController@delete_article");
$router->add(route: "/username={name}/add_article", controller: "MainController@add_article");
$router->add(route: "/username={name}/import_style", controller: "MainController@import_style");
$router->add(route: "/username={name}/password={pwd}", controller: "MainController@manager_panel");


$url = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
// 分发请求
$router->dispatch($url);


